Package-level declarations

Types

Link copied to clipboard
@ApiStatus.Experimental
data class Category constructor(val id: String, val description: String)

A nonblank canonical category ID and its natural-language meaning, including caller-defined aliases.

Link copied to clipboard
@ApiStatus.Experimental
class CategoryMapping<T : Any>(instructions: String, values: Map<Category, T>)

A closed category domain paired with caller-owned values. Structural collections are copied; value references are retained and may themselves be mutable. Values, including Class tokens, never enter provider requests and are never instantiated or populated from model output. Categories follow the supplied map's iteration order; pass an ordered map for stable provider order.

Link copied to clipboard
@ApiStatus.Experimental
class ClassificationRequest : DecisionRequest

Text to classify with a ClassificationSpec. A classification request is a decision request whose spec has one choice question, so it goes anywhere a DecisionRequest goes. Its JSON is the decision request JSON. The input may be empty.

Link copied to clipboard
@ApiStatus.Experimental
sealed interface ClassificationResult

A provider assessment. No match, insufficient evidence, and operational failure are distinct.

Link copied to clipboard
@ApiStatus.Experimental
interface ClassificationService : ClassificationServiceMetadata

Provider-neutral closed-category classification; implementations own execution and provider integration.

Link copied to clipboard
@ApiStatus.Experimental
interface ClassificationServiceMetadata : ModelMetadata

Pure metadata for a classification model, independent of its provider client.

Link copied to clipboard
@ApiStatus.Experimental
class ClassificationSpec : DecisionSpec

A classification: one choice question that picks a category for some text. It is a decision spec with exactly one question, so a decision service can answer it and a decision response holds its result under question.

Link copied to clipboard
@ApiStatus.Experimental
enum FailureReason : Enum<FailureReason>

Operational failure categories. Raw provider messages and throwables are deliberately excluded. JSON writes each one as its lower-case name, such as invalid_response.

Link copied to clipboard
@ApiStatus.Experimental
sealed interface MappedClassificationResult<out T : Any>

A classification mapped to a caller-owned value. Non-selection variants are the original ClassificationResult.NoMatch, ClassificationResult.Inconclusive, and ClassificationResult.Failure.

Link copied to clipboard
@ApiStatus.Experimental
data class ModelProvenance constructor(val modelName: String, val provider: String, val version: String? = null, val requestId: String? = null)

Provider-reported identity of the model that produced an assessment. Optional version and request ID remain absent when unknown. This evidence does not assert calibration or resolve a model. Providers must supply identifiers suitable for the caller to retain, never credentials or payloads.

Functions

Link copied to clipboard
@ApiStatus.Experimental
fun classificationSpec(block: ClassificationSpec.Builder.() -> Unit): ClassificationSpec

Builds a classification spec with a Kotlin receiver block.